/*******************************************************************************
generate coefficient plots of the falsification tests
*******************************************************************************/

clear all
set matsize 800
set more off


use "${datapath}/fascism_db.dta",clear

* standardize dependent and independent vars
foreach var of varlist fascist_violence-strike_agr_1920 lpop1911-volunteers1866_pop rain1918-rain_var {
egen z_`var'=std(`var')
}

* relabel them
run "labels.do"
*******************************************************************************
*******************************************************************************
*******************************************************************************

eststo clear

****CONTROLS
local demo "z_lpop1911 z_lpop2 z_lpop3 z_lpop4 z_sh_pop_1911_be6"
local geo "z_larea z_centre_alt z_max_alt"
local rural "z_dlab z_shcrop z_landlord_ass"
local urban "z_ind_workers z_ind_firms z_literacy z_elites z_bourgeoisie"
local urban_literacy "z_ind_workers z_ind_firms z_elites z_bourgeoisie"
local urban_ind_firms "z_ind_workers z_literacy z_elites z_bourgeoisie"
local urban_ind_workers "z_ind_firms z_literacy z_elites z_bourgeoisie"
local corps "z_ard_vol_pop6m z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers_d"
local corps_no_ard "z_volunt_pop6m z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers_d"
local corps_no_vol "z_arditi_pop6m z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers_d"
local corps_no_ard_vol_pop6m "z_cruent_d z_veterans74_95 z_veterans96_00 z_army_suppliers"
*****


*** first stage
eststo fs_1: qui reg z_psu1919_vv z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo fs_2: qui reg z_psu1919_vv z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo fs_3: qui reg z_psu1919_vv z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban' province* , cl(circondario1921)
***psu1913_vv
eststo soc_1: qui reg z_psu1913_vv z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo soc_2: qui reg z_psu1913_vv z_excess_mf1918 `demo' `geo' `corps' province* , cl(circondario1921)
eststo soc_3: qui reg z_psu1913_vv z_excess_mf1918 `demo' `geo' `corps' `rural' `urban' province* , cl(circondario1921)
***literacy
eststo lit_1: qui reg z_literacy z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo lit_2: qui reg z_literacy z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province*  , cl(circondario1921)
eststo lit_3: qui reg z_literacy z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban_literacy' province* , cl(circondario1921)
***crime
foreach v in viol_crimes1874 crime1874 {
eststo `v'_1: qui reg z_`v' z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo `v'_2: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo `v'_3: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban' province* , cl(circondario1921)
}
***ind_workers
eststo indw_1: qui reg z_ind_workers z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo indw_2: qui reg z_ind_workers z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo indw_3: qui reg z_ind_workers z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban_ind_workers' province* , cl(circondario1921)
***ind_firms
eststo indf_1: qui reg z_ind_firms z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo indf_2: qui reg z_ind_firms z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo indf_3: qui reg z_ind_firms z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban_ind_firms' province* , cl(circondario1921)
*** strikes
foreach v in indstrike1913_4 indstrikers1913_4 {
eststo `v'_1: qui reg z_`v' z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo `v'_2: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo `v'_3: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban' province* , cl(circondario1921)
}
*** owners and agr strikes
foreach v in mlarge1885 ownfarm_lots1885 agrstrike1913_4 agrstrikers1913_4 {
eststo `v'_1: qui reg z_`v' z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo `v'_2: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo `v'_3: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban' province* , cl(circondario1921)
}
**** volunteers / mutue
foreach v in volunteers1866_pop volunteers1866d ass_memb1900s_pop ass1900s_d {
eststo `v'_1: qui reg z_`v' z_excess_mf1918 `demo' province* , cl(circondario1921)
eststo `v'_2: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* , cl(circondario1921)
eststo `v'_3: qui reg z_`v' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban' province* , cl(circondario1921)
}
***
foreach i in fascist1919_vv nationalist1919_vv monuments1921_pop monuments1921d{
eststo `i'_1: qui reg z_`i' z_excess_mf1918 `demo' province* ,cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' province* ,cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps' `rural' `urban' province* ,cl(circondario1921)
}
foreach i in  volunt_pop6m {
eststo `i'_1: qui reg z_`i' z_excess_mf1918 `demo' province*  ,cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps_no_vol' province* ,cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps_no_vol' `rural' `urban' province* ,cl(circondario1921)
}
foreach i in arditi_pop6m  {
eststo `i'_1: qui reg z_`i' z_excess_mf1918 `demo' province*  ,cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps_no_ard' province* ,cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps_no_ard' `rural' `urban' province* ,cl(circondario1921)
}
foreach i in ard_vol_pop6m ard_vol_d{
eststo `i'_1: qui reg z_`i' z_excess_mf1918 `demo' province*  ,cl(circondario1921)
eststo `i'_2: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps_no_ard_vol_pop6m' province* ,cl(circondario1921)
eststo `i'_3: qui reg z_`i' z_excess_mf1918 `demo' `geo' z_psu1913_vv `corps_no_ard_vol_pop6m' `rural' `urban' province* ,cl(circondario1921)
}
*


#delim ;

coefplot 	fs_1 fs_2 fs_3,													bylabel(Socialists 1919 (First Stage)) ||
			soc_1 soc_2 soc_3, 												bylabel(Socialists 1913) ||
			lit_1 lit_2 lit_3, 												bylabel(Literacy 1911) ||
			viol_crimes1874_1 viol_crimes1874_2 viol_crimes1874_3, 		bylabel(Violent Crimes 1874) ||
			crime1874_1 crime1874_2 crime1874_3, 						bylabel(Crime Rate 1874) ||
			indw_1 indw_2 indw_3, 												bylabel(Ind. Workers 1911) ||
			indf_1 indf_2 indf_3, 																bylabel(Ind. Firms 1911) ||
			indstrike1913_4_1 indstrike1913_4_2 indstrike1913_4_3, 					bylabel(Ind. Strikes 1913-4) ||
			indstrikers1913_4_1 indstrikers1913_4_2 indstrikers1913_4_3, 	bylabel(Ind. Strikers 1913-4) ||
			mlarge1885_1 mlarge1885_2 mlarge1885_3, 											bylabel(Large Landholding 1885) ||
			ownfarm_lots1885_1 ownfarm_lots1885_2 ownfarm_lots1885_3, 						bylabel(Landownership 1885) ||
			agrstrike1913_4_1 agrstrike1913_4_2 agrstrike1913_4_3, 				bylabel(Agr. Strikes 1913-4) ||
			agrstrikers1913_4_1 agrstrikers1913_4_2 agrstrikers1913_4_3, 		bylabel(Agr. Strikers 1913-4) ||
			volunteers1866_pop_1 volunteers1866_pop_2 volunteers1866_pop_3, 					bylabel(Volunteers in 1866) ||
			volunteers1866d_1 volunteers1866d_2 volunteers1866d_3, 						bylabel(Volunteers in 1866 (Binary)) || 
			ass_memb1900s_pop_1 ass_memb1900s_pop_2 ass_memb1900s_pop_3, 					bylabel(Assoc. Members in 1900s) ||
			ass1900s_d_1 ass1900s_d_2 ass1900s_d_3, 									bylabel(Associations in 1900s (Binary)) ||
			fascist1919_vv_1 fascist1919_vv_2 fascist1919_vv_3, 				bylabel(Fascists 1919) ||
			nationalist1919_vv_1 nationalist1919_vv_2 nationalist1919_vv_3, 	bylabel(Nationalists 1919) ||
			monuments1921_pop_1 monuments1921_pop_2 monuments1921_pop_3, 		bylabel(Monuments Per Capita 1921) ||
			monuments1921d_1 monuments1921d_2 monuments1921d_3, 				bylabel(Monuments 1921 (Binary)) ||
			arditi_pop6m_1 arditi_pop6m_2 arditi_pop6m_3, 						bylabel(Arditi Casualties) ||
			volunt_pop6m_1 volunt_pop6m_2 volunt_pop6m_3,						bylabel(Volunteers Casualties) ||
			ard_vol_pop6m_1 ard_vol_pop6m_2 ard_vol_pop6m_3, 					bylabel(Arditi and Volunteers Casualties) ||
			ard_vol_d_1 ard_vol_d_2 ard_vol_d_3, 								bylabel(Arditi and Volunteers Casualties (Binary)) ||,
			bycoefs  keep(z_excess_mf1918) xline(0) msymbol(s) msize(vsmall) ci(95) ciopts(recast(rcap))  headings(2 = "{bf: Predetermined Outcomes}" 18 = "{bf: War-Related Outcomes}")
			plotregion(color(white)) xlabel(, nogrid) ylabel(, labsize(vsmall))  xscale(lcolor("black") fextend) yscale(lcolor("black")  fextend)  ysize(6) legend(off); 
		
#delim cr


graph export "${outpath}/figA4a.png", replace width(4000)
